﻿using System.Windows;
using System.Windows.Controls;
using ShellLight.Contract;
using ShellLight.Contract.Events;
using ShellLight.ModuleExample.Events;

namespace ShellLight.ModuleExample.Views
{
    public partial class TestView : UserControl
    {
        private readonly UICommandContext context;

        public TestView()
        {
            InitializeComponent();
        }

        public TestView(UICommandContext context):this()
        {
            this.context = context;
            parameterTextBlock.Text = "command parameter: " + context.Parameter;
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            context.Events.GetEvent<SomethingUpdatedEvent>().Publish(new Something());
        }
    }
}


